import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_logger_server/flutter_logger_server.dart';
import 'package:flutter_logger_server/flutter_logger_server_platform_interface.dart';
import 'package:flutter_logger_server/flutter_logger_server_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterLoggerServerPlatform
    with MockPlatformInterfaceMixin
    implements FlutterLoggerServerPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterLoggerServerPlatform initialPlatform = FlutterLoggerServerPlatform.instance;

  test('$MethodChannelFlutterLoggerServer is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterLoggerServer>());
  });

  test('getPlatformVersion', () async {
    FlutterLoggerServer flutterLoggerServerPlugin = FlutterLoggerServer();
    MockFlutterLoggerServerPlatform fakePlatform = MockFlutterLoggerServerPlatform();
    FlutterLoggerServerPlatform.instance = fakePlatform;

    expect(await flutterLoggerServerPlugin.getPlatformVersion(), '42');
  });
}
